package com.scientificInfo.handler;

import com.scientificInfo.entity.TSMResult;
import com.scientificInfo.exception.GlobalException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(GlobalException.class)
    @ResponseBody
    public TSMResult fcExceptionHandle(GlobalException e) {
        return new TSMResult(10010, e.getMessage(), 200);
    }
}
